import { Injectable } from '@angular/core';
import { Http } from '@angular/http';

import { HttpService } from './HttpService';

@Injectable()
export class UserService {
  constructor (
    private http: Http,
    private httpService: HttpService
  ) {}

  login(user) {
    let url = '/api/user/login';
    return this.httpService.httpPostNoAuth(url, user);
  }

  isLogin(login) {
    let url = '/api/user/isLogin';
    return this.httpService.httpPostNoAuth(url, login)
  }

  register(user) {
    let url = '/api/user/register';
    return this.httpService.httpPostNoAuth(url, user);
  }

  forgotPassword(user) {
    let url = '/api/user/forgotPassword';
    return this.httpService.httpPostNoAuth(url, user);
  }
}
